﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Configuration;
using System.Data;
using WdpaFeedbackServiceRef;

public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!Page.IsPostBack)
        {
            WdpaFeedbackService WdpaFeedbackService1 = new WdpaFeedbackService();

            feedbackCat.DataSource = WdpaFeedbackService1.getFeedbackCat();

            feedbackCat.DataBind();
        }
    }

    protected void commentBox_TextChanged(object sender, EventArgs e)
    {
        Label1.Visible = false;
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        WdpaFeedbackService WdpaFeedbackService1 = new WdpaFeedbackService();


        if (User.Identity.IsAuthenticated)
        {
            WdpaFeedbackService1.SubmitFeedback(commentBox.Text, User.Identity.Name.ToString(), UrlListBox.Text);
        }
        else
        {
            WdpaFeedbackService1.SubmitFeedback(commentBox.Text, "Not Logged In", UrlListBox.Text);
        }

        Label1.Visible = true;

        FeedbackEntered.Style.Value = "display:block;";
        feedbackform.Style.Value = "display:none;";
    }
}
